﻿using System;
using System.Windows.Data;
using Telerik.Windows.Controls.Scheduler;

namespace MedLink2011.Views.Patients.Controls.FirstLook.Converters
{
    public class DateFormatConverter : IValueConverter
    {

        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Occurrence occ = value as Occurrence;
            if (occ != null)
            {
                return ((DateTime)occ.Start).ToString("D") + ", from " + occ.Start.ToShortTimeString() + " to " + occ.End.ToShortTimeString() + ", room " + (occ.Appointment as SessionAppointment).SessionRoom;
            }
            return DateTime.Now;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
